//
//  LYFDetailsModel.m
//  段子手
//
//  Created by dllo on 16/3/21.
//  Copyright © 2016年 JokesTeam. All rights reserved.
//

#import "LYFDetailsModel.h"

@implementation LYFDetailsModel

- (instancetype)initWithDic:(NSDictionary *)dic {
    self = [super initWithDic:dic];
    if (self) {
        
    }
    return self;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    if ([key isEqualToString:@"group"]) {
        self.name = value[@"user"][@"name"];
        self.avatar_url = value[@"user"][@"avatar_url"];
        self.text = value[@"text"];
        self.group_id = value[@"group_id"];
        
        NSArray *urlArr = value[@"middle_image"][@"url_list"];
        if (urlArr.count) {
            NSDictionary *dic = urlArr[0];
            self.url = dic[@"url"];
        }
        
        NSDictionary *dicc = value[@"middle_image"];
        self.width = [dicc[@"width"] stringValue];
        self.height = [dicc[@"height"] stringValue];
        
        
        
        self.bury_count = [value[@"bury_count"] stringValue];
        self.digg_count = [value[@"digg_count"] stringValue];
        self.comment_count = [value[@"comment_count"] stringValue];
        self.share_count = [value[@"share_count"] stringValue];
    }
}

@end
